
#ifndef SERIES_H
#define SERIES_H

#pragma warning(disable:4251)

#include <BMap>
#include <BRect>
#include <BColor>
#include <BIcon>
#include <BObject>

using namespace BWE;

typedef BMap<BReal, BReal>	RealMap;

class Series : public BObject
{
	friend class ChartView;
public:
	Series(const BString& name = BString());
	~Series();

	void setVisible(bool visible);
	bool visible() const;

	void setUnit(const BString& unit);
	const BString& unit() const;

	void setLineWidth(float lineWidth);
	float lineWidth() const;

	void setLineColor(const BColor& color);
	const BColor& lineColor() const;

	void insertValue(BReal key, BReal value);
	void replaceValue(int pos, BReal value);
	void removeValue(int pos, int count);

	void setValueMap(const RealMap& valueMap);
	const RealMap& valueMap() const;

	void clearValue();

	BReal interpValue(BReal key);

private:
	bool			_dirty;
	bool			_visible;
	BIconHolder		_icon;
	BString			_unit;
	BColor			_lineColor;
	float			_lineWidth;
	BMap<BReal, BReal>	_valueMap;

};

typedef BHolder<Series>		SeriesHolder;
typedef BArray<Series*>		SeriesArray;

#endif
